<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>微观世界</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <!--[if IE]>
    <script src="<?php echo SCScabish::core('url')->root?>/public/js/html5.js"></script>
    <![endif]-->
    <link rel="stylesheet" href="<?php echo SCScabish::core('url')->root?>/public/style/style.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="<?php echo SCScabish::core('url')->root?>/public/js/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="<?php echo SCScabish::core('url')->root?>/public/js/dialog/skins/default.css" type="text/css" media="screen" />
    <script src="<?php echo SCScabish::core('url')->create('server/side')?>" type="text/javascript"></script>
    <script src="<?php echo SCScabish::core('url')->root?>/public/js/jquery.js" type="text/javascript"></script>
    <script src="<?php echo SCScabish::core('url')->root?>/public/js/fancybox/jquery.fancybox.js" type="text/javascript"></script>
    <script src="<?php echo SCScabish::core('url')->root?>/public/js/fancybox/jquery.mousewheel.js" type="text/javascript"></script>
    <script src="<?php echo SCScabish::core('url')->root?>/public/js/dialog/jquery.artdialog.min.js" type="text/javascript"></script>
    <script src="<?php echo SCScabish::core('url')->root?>/public/js/u/index.js" type="text/javascript"></script>
</head>
<body>
	
	<?php require $this->view->load('header'); ?>
    
    <section id="SC_container" style="padding-top:50px;">
    	<section id="SC_left">
    		<div class="profile">
    			
    			<div style="height:180px;">
    				<img src="<?php echo $user_info->avatar_3?>" style="width:180px;max-width:180px;" />
    			</div>
    			
    			<p><?php echo $user_info->nickname?></p>
    			
    		</div>
    	</section>
    	<section id="SC_middle">
    		<div id="origin">
    		
    		</div>
    		
    		<div id="things">
	    		<?php foreach($things as $v) { ?>
	    		<div class="thing" data-thing-id="<?php echo $v->thing_id?>" data-thing-type="<?php echo $v->type?>">
	    			<div class="timeline" style="visibility:hidden;">
	    				<a href="<?php echo SCScabish::core('url')->create('thing/view/thing_id/'.$v->thing_id)?>" target="_blank"><?php echo $v->post_date?></a>
	    			</div>
	    			<div class="content">
						<?php echo nl2br($v->text)?>
	    			</div>
	    			<?php if($v->type == 'photo') { ?>
		    		<div class="photo">
	    				<div class="medium">
		    				<img src="<?php echo SCScabish::core('url')->root?>/upload/<?php echo $v->photos[0]->thumbs[400]['path']?>" />
		    				<span class="count"><?php echo count($v->photos)?>p</span>
	    				</div>
	    				<ul class="thumbnail">
	    					<?php foreach($v->photos as $i=>$photo) { ?>
	    					<li<?php if($i > 5){?> style="display:none;"<?php }?>>
	    						<a class="fancybox" rel="group<?php echo $v->thing_id?>" href="<?php echo SCScabish::core('url')->root?>/upload/<?php echo $photo->path?>" title="<?php echo $v->text?>" onclick="return false;">
	    							<img src="<?php echo SCScabish::core('url')->root?>/upload/<?php echo $photo->thumbs[80]['path']?>" />
	    						</a>
	    					</li>
	    					<?php } ?>
	    				</ul>
	    			</div>
		    		<?php } elseif($v->type == 'video') { ?>
		    		<div class="video">
	    				<img src="<?php echo SCScabish::core('url')->root?>/upload/<?php echo $v->video->preview_path?>" width="<?php echo $v->video->preview_width?>" height="<?php echo $v->video->preview_height?>" />
	    				<div class="play" data-video-url="<?php echo $v->video->url?>" 
	    					data-video-width="<?php echo $v->video->width?>" data-video-height="<?php echo $v->video->height?>">
	    				</div>
	    			</div>
	    			<div class="player" style="display:none;"></div>
		    		<?php } elseif($v->type == 'music') {?>
		    		<div class="music">
	    				<img src="<?php echo SCScabish::core('url')->root?>/upload/<?php echo $v->music->preview_path?>" width="<?php echo $v->music->preview_width?>" height="<?php echo $v->music->preview_height?>" />
	    				<div class="play" data-music-url="<?php echo $v->music->url?>" 
	    					data-music-width="<?php echo $v->music->width?>" data-music-height="<?php echo $v->music->height?>">
	    				</div>
	    			</div>
	    			<div class="player" style="display:none;"></div>
		    		<?php } ?>
	    			<div class="opt clear">
	    				<a class="echo" href="javascript:;"><span class="echo-num"><?php echo $v->comment_num ? $v->comment_num : ''?></span></a>
	    				<a class="share" href="javascript:;"></a>
	    				<a class="mark" href="javascript:;"></a>
	    			</div>
	    			<div class="echoes" style="display:none"></div>
	    		</div>
	    		<?php } ?>
    		</div>
    		
    		<div id="thing_loading" class="thing-loading" data-loading="no">继续往下↓</div>
    	</section>
    	<section id="SC_right">
    		<ul class="thing-type">
    			<li><a class="text" href="" title="文字"></a></li>
    			<li><a class="photo" href="" title="图片"></a></li>
    			<li><a class="music" href="" title="音乐"></a></li>
    			<li><a class="video" href="" title="视频"></a></li>
    		</ul>
    	</section>
    	<div class="clear"></div>
    </section>
    
    <script type="text/javascript">
	$(function() {
		// 初始化thing
		Thing.init({'host_user_id' : '<?php echo $user_info->user_id?>'});
	});
    </script>
    
    <?php require $this->view->load('footer'); ?>
    
</body>
</html>   